import Vue from "vue";
import VueRouter from "vue-router";

/* routes start */
import { homeRoutes } from "../views/home/components/router/index";
import { categoryRoutes } from "../views/category/components/router/index";
import { messagesRoutes } from "../views/messages/components/router/index";
import { meRoutes } from "../views/me/components/router/index";
import { loginRoutes } from "../views/login/components/router/index";

// 导入所有router
export const routes = [
  ...homeRoutes,
  ...categoryRoutes,
  ...messagesRoutes,
  ...meRoutes,
];

const routeGroup = [...routes, ...loginRoutes];

/* routes end */

Vue.use(VueRouter);
export const router = new VueRouter({
  mode: "history",
  routes: routeGroup,
});
